package constant.milk.cashbook.util;

import constant.milk.cashbook.R;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;

public class MilkTextView extends TextView
{
	public MilkTextView(Context context, AttributeSet attrs, int defStyle) 
	{        
		super(context, attrs, defStyle);         
		setTypeface(context);     
	}       
	
	public MilkTextView(Context context, AttributeSet attrs) 
	{         
		super(context, attrs);         
		setTypeface(context);  
	}       
	
	public MilkTextView(Context context) 
	{         
		super(context);
		setTypeface(context);
	}           
	
	private void setTypeface(Context context)
	{    
		MilkTypeFace milkTypeFace = null;
		
		try
		{
			milkTypeFace = MilkTypeFace.getInstance(context);
			
			setTypeface(milkTypeFace.getTypeface(context));
		} catch (Exception e)
		{
			e.printStackTrace();
		} 
	} 
}
